SocksServerHandler{ }
toHexString{
  StringBuffer out=new StringBuffer(blob.length * 2 + 1);
}
messageReceived{
  io.netty.channel.MessageEvent.getMessage
  io.netty.channel.Channels.write
    io.netty.channel.Channel.isWritable
      io.netty.buffer.ChannelBuffer.array
      io.netty.channel.Channels.write
      io.netty.channel.MessageEvent.getChannel
    return;
  if (socksProtocol == null) {
    try {
      socksProtocol=SocksProtocols.create(msg);
      io.netty.channel.MessageEvent.getChannel
      return;
  try {
    socksProtocol.processMessage(msg);
    io.netty.channel.MessageEvent.getChannel
    return;
  if (socksProtocol instanceof Socks5Protocol) {
    Socks5Protocol s5=(Socks5Protocol)socksProtocol;
    isBind=s5.isBIND();
    isConnect=s5.isCONNECT();
  if (isConnect && socksProtocol.isReady()) {
    final InetSocketAddress outboundAddress=socksProtocol.getOutboundAddress();
    System.out.println("Connect " + outboundAddress);
    io.netty.channel.MessageEvent.getChannel
    io.netty.channel.Channel.setReadable
    io.netty.bootstrap.ClientBootstrap.<init>
    io.netty.bootstrap.ClientBootstrap.connect
    io.netty.channel.ChannelFuture.addListener
      @Override public void operationComplete(      ChannelFuture outboundClientFuture) throws Exception {
        if (outboundClientFuture.isSuccess()) {
          io.netty.channel.MessageEvent.getChannel
          socksProtocol.setConnected(true);
          if (socksProtocol.hasResponse()) {
            byte[] res=socksProtocol.getResponse();
            io.netty.buffer.ChannelBuffers.wrappedBuffer
          socksProtocol.setConnected(false);
          io.netty.channel.Channel.isWritable
            io.netty.buffer.ChannelBuffers.wrappedBuffer
 else   if (socksProtocol.hasResponse()) {
    io.netty.buffer.ChannelBuffers.wrappedBuffer
}
operationComplete{
  io.netty.channel.ChannelFuture.isSuccess
    io.netty.channel.ChannelFuture.getChannel
    io.netty.channel.Channel.setReadable
    socksProtocol.setConnected(true);
    if (socksProtocol.hasResponse()) {
      byte[] res=socksProtocol.getResponse();
      io.netty.buffer.ChannelBuffers.wrappedBuffer
    socksProtocol.setConnected(false);
    io.netty.channel.Channel.isWritable
      io.netty.channel.Channels.write
}
channelClosed{
  io.netty.channel.ChannelStateEvent.getChannel
}
exceptionCaught{
  System.out.println("C");
  io.netty.channel.Channels.close
    io.netty.channel.Channels.close
}
closeOnFlush{
  io.netty.channel.Channel.isConnected
    io.netty.channel.Channel.write
}
write{
  io.netty.channel.Channel.isWritable
    io.netty.channel.Channel.write
 else {
    io.netty.channel.Channel.setReadable
}
